import request from "@/utils/request";

//查询成品检验单列表
export function getcpList(query) {
  return request({
    url: "/quality/finishedExamine/list",
    method: "post",
    params: query,
  });
}

// 新增成品检验单列表
export function addCP(data) {
  return request({
    url: "/quality/finishedExamine/add",
    method: "post",
    data: data,
  });
}
// 上传成品检验单
export function uploadCp(data) {
  return request({
    url: "/quality/finishedExamine/upload",
    method: "post",
    data: data,
  });
}
//完成成品检验单
export function completedCp(data) {
  return request({
    url: "/quality/finishedExamine" ,
    method: "PUT",
    data
  });
}
// 删除成品检验单
export function delCp(id) {
  return request({
    url: "/quality/finishedExamine/delete/id?id=" + id,
    method: "delete",
  });
}
// 下载附件
export function downloadFile(data) {
  return request({
    url: "/system/uploads/common/download/resource?resource="+data,
    method: "get"
  });
}
 
// 删除附件
export function delFile(ids) {
  return request({
    url: "/system/file/"+ids,
    method: "delete",

  });
}
//查询附件
export function getFile(data) {
  return request({
    url: "/system/file/list",
    method: "get",
    params:data
  });
}
//图片预览

export function preImages(data) {
  return request({
    url: "/system/file/getImgs",
    method: "get",
    params:data
  });
}